package com.hangwei.paperless.view.window.acceptsee;

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.hangwei.paperless.MainSeeActivity;
import com.hangwei.paperless.R;
import com.hangwei.paperless.adapter.accept.Item0Adapter;
import com.hangwei.paperless.model.bean.AcceptCheckInfo;
import com.hangwei.paperless.view.BaseView;
import com.hangwei.paperless.widget.MaxRecyclerView;

import java.util.List;

/**
 * Created by 张龙臣 on 2020/11/24.
 */

public class AcceptItem0See extends BaseView<MainSeeActivity, List<AcceptCheckInfo.TBean>> {

    private MaxRecyclerView mRecyclerView;
    private Item0Adapter mAdapter;

    public AcceptItem0See(MainSeeActivity activity) {
        super(activity);
    }

    @Override
    protected View initView() {
        View inflate0 = LayoutInflater.from(mActivity).inflate(R.layout.page_accept_check_view0, null);
        TextView tvMsg0 = inflate0.findViewById(R.id.tvMsg);
        tvMsg0.setText("1、主要零件状态 Main Components Condition");
        TextView tvSave0 = inflate0.findViewById(R.id.tvSave);
        TextView tvAdd = inflate0.findViewById(R.id.tvAdd);
        mRecyclerView = inflate0.findViewById(R.id.recyclerView);
        inflate0.findViewById(R.id.back).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mActivity.finish();
            }
        });

        tvSave0.setOnClickListener(this);
        tvAdd.setOnClickListener(this);
        return inflate0;
    }

    @Override
    public void bindData(List<AcceptCheckInfo.TBean> list) {
        mRecyclerView.setLayoutManager(new LinearLayoutManager(mActivity));
        mAdapter = new Item0Adapter(list);
        mAdapter.setEnable(false);
        mRecyclerView.setAdapter(mAdapter);
    }
}
